﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KPIS.GERP.GIMS.MODEL;
using KPIS.GERP.GIMS.IBLL;
using KPIS.GERP.GIMS.IDAL;
using KPIS.GERP.GIMS.DALFactory;
using KPIS.DBM;

namespace KPIS.GERP.GIMS.BLL
{
    public class MasterPurchaseRuleMappingBLL : IBLLMasterPurchaseRuleMapping
    {
        private static readonly IDALMasterPurchaseRuleMapping dal = DataAccess.CreateMasterPurchaseRuleMapping();

        public MasterPurchaseRuleMappingBLL()
        {

        }

        public IList<MasterPurchaseRuleMappingInfo> GetMasterPurchaseRuleMapping()
        {
            return dal.GetMasterPurchaseRuleMapping();
        }

        public IList<MasterPurchaseRuleMappingInfo> GetMasterPurchaseRuleMapping(string record_status)
        {
            return dal.GetMasterPurchaseRuleMapping(record_status);
        }

        public IList<MasterPurchaseRuleMappingInfo> GetMasterPurchaseRuleMappingWithRule(int pc_rule_seq)
        {
            return dal.GetMasterPurchaseRuleMappingWithRule(pc_rule_seq);
        }

        public MasterPurchaseRuleMappingInfo GetMasterPurchaseRuleMapping(int seq)
        {
            return dal.GetMasterPurchaseRuleMapping(seq);
        }

        public void Insert(IList<MasterPurchaseRuleMappingInfo> infoList, int rule_seq, IDBManager dbManagerTrans)
        {
            try
            {
                dal.Insert(infoList, rule_seq, dbManagerTrans);
            }
            catch
            {
                throw;
            }
        }

        public void Update(MasterPurchaseRuleMappingInfo info)
        {
            try
            {
                dal.Update(info);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(MasterPurchaseRuleMappingInfo info)
        {
            try
            {
                dal.Delete(info);
            }
            catch
            {
                throw;
            }
        }

        public void DeleteAll(IList<MasterPurchaseRuleMappingInfo> infoList)
        {
            try
            {
                dal.DeleteAll(infoList);
            }
            catch
            {
                throw;
            }
        }

        public void DeleteFromDB(IList<MasterPurchaseRuleMappingInfo> infoList)
        {
            try
            {
                dal.DeleteFromDB(infoList);
            }
            catch
            {
                throw;
            }
        }

        public void DeleteFromDB(Nullable<int> rule_seq, IDBManager dbManagerTrans)
        {
            try
            {
                dal.DeleteFromDB(rule_seq, dbManagerTrans);
            }
            catch
            {
                throw;
            }
        }

        public void Restore(IList<MasterPurchaseRuleMappingInfo> infoList)
        {
            try
            {
                dal.Restore(infoList);
            }
            catch
            {
                throw;
            }
        }
    }
}
